projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7915e99
)
flowbox: Avoid a crash in measure()
author
Matthias Clasen
<mclasen@redhat.com>
Thu, 14 May 2020 00:32:30 +0000
(20:32 -0400)
committer
Matthias Clasen
<mclasen@redhat.com>
Thu, 14 May 2020 01:47:11 +0000
(21:47 -0400)
When the children request a height of zero, the
flowbox measure() function was happily dividing
by that zero, leading to badness.
gtk/gtkflowbox.c
patch
|
blob
|
history
diff --git
a/gtk/gtkflowbox.c
b/gtk/gtkflowbox.c
index 26b78e3fa38525de6eb0653c0c435ca4acc27945..5c022d45cd6f44913d36b32bbe040fa9213ae916 100644
(file)
--- a/
gtk/gtkflowbox.c
+++ b/
gtk/gtkflowbox.c
@@
-2075,6
+2075,8
@@
gtk_flow_box_measure (GtkWidget *widget,
goto out_width;
get_max_item_size (box, GTK_ORIENTATION_VERTICAL, &min_item_height, &nat_item_height);
+ if (nat_item_height <= 0)
+ goto out_width;
/* By default flow at the natural item width */
line_length = avail_size / (nat_item_height + priv->row_spacing);